<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" session="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="0">
    <title>基本资料</title>

    <link href="${pageContext.request.contextPath}/static/css/common.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/css/bootstrap.min.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/font-awesome-4.3.0/css/font-awesome.min.css"
          rel="stylesheet">
    <!-- jqgrid-->
    <link href="${pageContext.request.contextPath}/static/plugins/jqGrid/css/custom.ui.jqgrid.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/layer/skin/layer.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/jqGrid/css/style.css" rel="stylesheet">

    <script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/jquery.form.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/common.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/jqGrid/js/i18n/grid.locale-cn.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/jqGrid/js/minified/jquery.jqGrid.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/layer/layer.js" type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/static/js/global.js"></script>
	<script src="${pageContext.request.contextPath}/static/plugins/select2-4.0.0/dist/js/select2.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/static/plugins/My97DatePicker/WdatePicker.js"></script>
	<style>
        .main h5 a {
            position: absolute;
            right: 20px;
            font-size: 14px;
            bottom: 0px;
            display: inline-block;
            padding: 5px;
        }

        .table_list tbody tr {
            height: 35px;
            text-align: center;
        }
        .l{
		   width: 100%;
		   *width: 84%;
		   height: 1px;
		   background: #000;
		   display: block;
		   float: left;
		   margin-top: 16px;
		   margin-bottom: 10px;
		   *+margin-left:280px;
		}
		.lable{
			font-size: 16px;
			width: 10%;
			float:left;
		}
		.h1{
			margin-top: 0px;
			width: 80%;
    		font-size: 20px !important;
		}
		.left ul li{
			*+padding:0px 20px 10px;
			
			*+line-height:40px;
			*+padding-left:20px;
		}
		.left li{
			
		}
		
		.left ul li a, .left ul li a:hover{
			*+color:#fff;
		}
		.list-tab li{
			*+padding:0px 10px 10px;
		}
		.col-sm-12,.line{
			*margin-left:270px;
		}
		.lt{
			float:left;
		}
		.input-group  a{
			display:inline-block\9;
			*+display:inline-block;
			width:52px\9;
			*+width:30px;
			height:34px\9;
			*+height:26px;
			*+line-height:26px;
			position:absolute\9;
		}
		.input-group .form-control{
			width:550px\9;
			*+width:626px;
		}
		.form-control{
			width:600px\9;
			*height:26px;
			*line-height:26px;
			*width:700px;
		}
		
		.form-group{
			overflow: hidden\9;
			*overflow: hidden;
		}
		.control-label{
			width:150px\9;
			*width:70px;
			text-align:right\9;
			*text-align:right;
			*height:26px;
			*line-height:26px;
			display:inline-block\9;
			*display:inline-block;
		}
		.form-horizontal{
			padding-left:80px\9;
			*padding-left:150px;
		}
		.input-group{
			width:70px\9;
		}
		#sub{
			*+line-height:10px;
		}
		
    </style>    
</head>
<body view="menu-item-4142">
<jsp:include page="../../top.jsp"></jsp:include>
<div class="right">
	<div>
		<div>
        <div style="*height:30px;*margin-left:270px;">
            <label class="lable ">审核状态:</label>
            <div class="">
                <h1 class="h1">
                <c:if test="${map.status == 0 || map.status == 3}">审核中</c:if>
                <c:if test="${map.status == 1}">审核通过</c:if>
                <c:if test="${map.status == 2}">审核拒绝,请重新提交资料</c:if>
                </h1>
            </div>
        </div>
        <div>
        <c:if test="${map.status != 1}">
           <label class="lable">备注说明:</label>
           <div class="">
                <h1 class="h1">
                	<c:if test="${map.status == 0 || map.status == 3}">您的申请已提交；工作人员将在收到申请的一个工作日内完成审核。</c:if>
                	<c:if test="${map.status == 2}">
                	<c:if test="${empty map.comm}">无</c:if>
	                	<c:if test="${not empty map.comm}">${map.comm}</c:if>
	                </c:if>
                </h1>
            </div>
        </c:if>
        </div>
	</div>
	</div>
	<div class="l line"></div>
	<div class="jqGrid_wrapper">
		<div class="col-sm-12">
		    <form class="form-horizontal m-t" id="uploadForm">
		        <input type="hidden" name="sid" value="${map.sid}">
		        <div class="form-group">
		            <div class="col-sm-3 lt control-label">账号:</div>
		            <div class="col-sm-8 lt">
		                <input class="form-control" name="adminUser" size="30" value="${map.adminUser}" disabled="disabled"/>
		            </div>
		        </div>
		        <div class="form-group">
		            <div class="col-sm-3 lt control-label">密码:</div>
		            <div class="col-sm-8 lt">
		                <div class="input-group" style="position:relative">
		                    <input class="form-control" type="password" readonly size="30" value="******"/>
		                    <a class="input-group-addon btn btn-primary" href="javascript:void(0);">修改</a>
		                </div>
		            </div>
		         </div>
		         <div class="form-group">
		            <div class="col-sm-3 lt control-label"><i class="require">*</i>公司名称:</div>
		            <div class="col-sm-8 lt">
		                <input class="form-control" name="agtName" id="agtName" size="30" value="${map.agtName}"/>
		            </div>
		        </div>
		        <div class="form-group">
			        <div class="col-sm-3 lt control-label"><i class="require">*</i>联系人:</div>
			        <div class="col-sm-8 lt">
			            <input class="form-control" name="agtContact" id="agtContact" size="30" value="${map.agtContact}"/>
			        </div>
			    </div>
			    <div class="form-group">
			        <div class="col-sm-3 lt control-label"><i class="require">*</i>联系方式:</div>
			        <div class="col-sm-8 lt">
			            <input class="form-control" name="agtTel" id="agtTel" size="30" value="${map.agtTel}"/>
			        </div>
			    </div>
		    	<div class="form-group">
				        <div class="col-sm-3 lt control-label"><i class="require">*</i>所属区域:</div>
			        	<div class="col-sm-8 lt" id="region">
			            	<input type="hidden" name="areaCode" value="${map.areaCode}">
			            	<div class="input-group" style="position:relative;">
				                <input class="form-control" readonly size="30"
				                       value="${map.described}"/>
				                <a class="input-group-addon btn  btn-primary" onclick="loadRegions();" >修改</a>
			            	</div>
			        	</div>
			        </div>
			       	<div class="form-group">
			            <div class="col-sm-3 lt control-label ">地址:</div>
			            <div class="col-sm-8 lt">
			                <input class="form-control" name="address" id="address" size="30" value="${map.address}"/>
			            </div>
			        </div>
		            <c:if test="${map.status != 1}">
		        	<div class="form-group">
			            <label class="col-sm-3 col-sm-3 control-label">营业执照:</label>
			            <div class="col-sm-8">
			                <div class="input-group">
			                    <input class="form-control" name="agtAttr"  id="agtAttr" readonly="readonly" size="30"/>
			                    <div class="input-group-addon upload">
			                        <input class="form-control" id="upload" type="file" name="upload"
			                               style="position: absolute;width: 60px;opacity: 0;"/>
			                        <a class="btn btn-primary">上传</a>
			                    </div>
			                </div>
			            </div>
		        	</div>
		        	</c:if>
			       <div style="text-align: center;">
			             <input class="btn btn-success form-control"  id="sub"  type="button" onclick="doUpload()" style="width: 150px;" value="提交">
			         </div>
		    </form>
		</div>
	</div>
</div>
<script type="text/javascript">

window.onload = function(){
	var isTipCustom = '${isTipCustom}';//关于定制app资料的提醒
	if(isTipCustom=='1'){
		layer.open({
			type : 2,
			title : [ '申请提示', 'font-weight:bold' ],
			//title:false,
			shadeClose : true, //点击遮罩关闭层
			area : [ '600px', '330px' ],
			scrollbar : false,
			content : '${pageContext.request.contextPath}/jsp/tipCustomApp.jsp',
			yes : function(index, layero) {
				var options = {
					success : function(data) {
						data = JSON.parse(data);
						if (data.code == 1) {
							layer.alert(data.msg, function() {
								layer.closeAll();
								refreshGrid();
							});
						} else {
							layer.alert(data.msg);
						}
					}
				};
				$("#layui-layer-iframe" + index).contents().find(
						"#form").ajaxForm(options);
				$("#layui-layer-iframe" + index).contents().find(
						"#form").submit();
			},
			cancel : function(index, layero) {
				layer.close(index);
			}
		});
	}
}

$(".input-group-addon").click(function () {
    var $input = $(this).prev();
    $input.removeAttr("readonly");
    $input.attr("name", "comm");
    $input.attr("id", "comm");
    $input.val("");
});
function upload() {
    document.getElementById("upload").click();
}
 $("#upload").change(function () {
        var filename = $(this).val();
        var index = filename.lastIndexOf("\\");
        $("input[name='agtAttr']").val(filename.substring(index + 1));
  });
function doUpload() {  
	$("#sub").attr("disabled", "true");
	var formData = new FormData($( "#uploadForm" )[0]); 
    var agtName = $("#agtName").val();
    var agtContact = $("#agtContact").val();
    var agtTel = $("#agtTel").val();
    var selects=document.getElementsByName('areaCode');
    var areaCode = selects[0].value;
    var agtAttr = $("#agtAttr").val();
    if(!agtName){
    	 alert("公司名称必填");
    	 $("#sub").removeAttr("disabled");
    	 return;
    }
    if(!agtContact){
    	 alert("联系人姓名必填");
    	 $("#sub").removeAttr("disabled");
    	 return;
    }
    if(!agtTel){
    	 alert("联系方式必填");
    	 $("#sub").removeAttr("disabled");
    	 return;
    }
    if(!areaCode){
    	 alert("所属区域必填");
    	 $("#sub").removeAttr("disabled");
    	 return;
    }
    $.ajax({  
         url: '${pageContext.request.contextPath}/admin/tagent_updateDetail.action' ,  
         type: 'POST',  
         data: formData,  
         async: false,  
         cache: false,  
         contentType: false,  
         processData: false,  
         success: function (result) {  
              result = JSON.parse(result)
              if (result.code == 1) {
             	 layer.alert(result.msg);
             	 $("#sub").removeAttr("disabled");
              }else{
             	 $("#sub").removeAttr("disabled");
              	 layer.alert(result.msg);
              }
         },  
         error: function (returndata) {  
             alert(returndata);  
         }  
    });  
} 

</script>
</body>
</html>
